home *** CD-ROM | disk | FTP | other *** search
/ DIM Series: Yumi Fukawa / DIM Series: Yumi Fukawa.iso / pc / data / photo_s.dxr / 00004_photo script.ls < prev    next >
Encoding:
Text File  |  1998-06-10  |  7.3 KB  |  243 lines

  1. global knumphotos, knummaxalbumphotos, kdefaultphotoorder, knumcategory, kcategoryphotonums, kcategorythumbnailsprnumbgn, kphotothumbnailsprnumbgn, kthumbnailmarkersprnum, kalbumfullerrstr, kcategorythumbnailstrsprnum, kphotothumbnailstrsprnum, kphotothumbnailhoriznum, kmaxphotothumbnailnum, galbumphotoorder, gcurphotoorder, gcurcategorynum, gcurphotonum, gsavedalbummodephotonum, gcategorythumbnailonstage, gphotothumbnailonstage, galbummode, gcurmovienum, gsavedphotomodephotonum
  2.  
  3. on showhidecategorythumbnail
  4.   playclicksnd()
  5.   busycurs()
  6.   if gcategorythumbnailonstage then
  7.     hidecategorythumbnail()
  8.   else
  9.     hidephotothumbnail()
  10.     showcategorythumbnail()
  11.   end if
  12.   updateStage()
  13.   resetcurs()
  14. end
  15.  
  16. on showcategorythumbnail
  17.   repeat with acategorycount = 1 to knumcategory
  18.     set athumbnailsprnum to kcategorythumbnailsprnumbgn + acategorycount - 1
  19.     sendSprite(athumbnailsprnum, #msetphotonum, getAt(getAt(kcategoryphotonums, acategorycount), 1))
  20.     sendSprite(athumbnailsprnum, #mupdatethumbnailview)
  21.     sendSprite(athumbnailsprnum, #mshowspr)
  22.   end repeat
  23.   set gcategorythumbnailonstage to 1
  24.   updatecategorythumbnailmarker()
  25.   sendSprite(kcategorythumbnailstrsprnum, #mshowspr)
  26.   sendSprite(kcategorythumbnailstrsprnum, #mlockvisiblestate)
  27. end
  28.  
  29. on hidecategorythumbnail
  30.   repeat with acategorycount = 1 to knumcategory
  31.     set athumbnailsprnum to kcategorythumbnailsprnumbgn + acategorycount - 1
  32.     sendSprite(athumbnailsprnum, #mhidespr)
  33.   end repeat
  34.   sendSprite(kthumbnailmarkersprnum, #mhidemarker)
  35.   set gcategorythumbnailonstage to 0
  36.   sendSprite(kcategorythumbnailstrsprnum, #munlockvisiblestate)
  37.   sendSprite(kcategorythumbnailstrsprnum, #mhidespr)
  38. end
  39.  
  40. on updatecategorythumbnailmarker
  41.   sendSprite(kthumbnailmarkersprnum, #msettargetsprnum, kcategorythumbnailsprnumbgn + gcurcategorynum - 1)
  42.   if gcategorythumbnailonstage then
  43.     sendSprite(kthumbnailmarkersprnum, #mshowmarker)
  44.   end if
  45. end
  46.  
  47. on getnumphotoincategory vcategorynum
  48.   return count(getAt(kcategoryphotonums, vcategorynum))
  49. end
  50.  
  51. on getphotocategorynum vphotonum
  52.   set acategorynum to 0
  53.   repeat with acategorycount = 1 to knumcategory
  54.     set aphotolist to getAt(kcategoryphotonums, acategorycount)
  55.     set apos to getPos(aphotolist, vphotonum)
  56.     if apos <> 0 then
  57.       set acategorynum to acategorycount
  58.       exit repeat
  59.     end if
  60.   end repeat
  61.   return acategorynum
  62. end
  63.  
  64. on categorythumbnailclickreaction vsprnum
  65.   playclicksnd()
  66.   set aclickedthumbnailnum to vsprnum - kcategorythumbnailsprnumbgn + 1
  67.   set gcurcategorynum to aclickedthumbnailnum
  68.   setcurphotonum(getnumprevphoto() + 1)
  69.   updatecategorythumbnailmarker()
  70. end
  71.  
  72. on showhidephotothumbnail
  73.   playclicksnd()
  74.   busycurs()
  75.   if gphotothumbnailonstage then
  76.     hidephotothumbnail()
  77.     updateStage()
  78.     unloadphotothumbnail()
  79.   else
  80.     hidecategorythumbnail()
  81.     showphotothumbnail()
  82.   end if
  83.   updateStage()
  84.   resetcurs()
  85. end
  86.  
  87. on unloadphotothumbnail
  88.   set alastmembernum to the number of castMembers of castLib "thumb"
  89.   unloadMember(member 1 of castLib "thumb", member alastmembernum of castLib "thumb")
  90. end
  91.  
  92. on showphotothumbnail
  93.   hidephotothumbnail()
  94.   set anumphoto to getnumphotoincategory(gcurcategorynum)
  95.   set athumbnailsprbgn to getphotothumbnailsprbgn()
  96.   set aphotonumlist to getAt(kcategoryphotonums, gcurcategorynum)
  97.   repeat with aphotocount = 1 to anumphoto
  98.     set athumbnailsprnum to athumbnailsprbgn + aphotocount - 1
  99.     sendSprite(athumbnailsprnum, #msetphotonum, getAt(aphotonumlist, aphotocount))
  100.     sendSprite(athumbnailsprnum, #mupdatethumbnailview)
  101.     sendSprite(athumbnailsprnum, #mshowspr)
  102.   end repeat
  103.   set gphotothumbnailonstage to 1
  104.   updatephotothumbnailmarker()
  105.   sendSprite(kphotothumbnailstrsprnum, #mshowspr)
  106.   sendSprite(kphotothumbnailstrsprnum, #mlockvisiblestate)
  107. end
  108.  
  109. on hidephotothumbnail
  110.   repeat with aphotocount = 1 to kmaxphotothumbnailnum
  111.     set athumbnailsprnum to kphotothumbnailsprnumbgn + aphotocount - 1
  112.     sendSprite(athumbnailsprnum, #mhidespr)
  113.   end repeat
  114.   sendSprite(kthumbnailmarkersprnum, #mhidemarker)
  115.   set gphotothumbnailonstage to 0
  116.   sendSprite(kphotothumbnailstrsprnum, #munlockvisiblestate)
  117.   sendSprite(kphotothumbnailstrsprnum, #mhidespr)
  118. end
  119.  
  120. on updatephotothumbnailmarker
  121.   set aphotonumlist to getAt(kcategoryphotonums, gcurcategorynum)
  122.   set anumprevphoto to getnumprevphoto()
  123.   set aphotopos to gcurphotonum - anumprevphoto
  124.   sendSprite(kthumbnailmarkersprnum, #msettargetsprnum, getphotothumbnailsprbgn() + aphotopos - 1)
  125.   if gphotothumbnailonstage then
  126.     sendSprite(kthumbnailmarkersprnum, #mshowmarker)
  127.   end if
  128. end
  129.  
  130. on photothumbnailclickreaction vsprnum
  131.   playclicksnd()
  132.   set aclickedthumbnailnum to vsprnum - getphotothumbnailsprbgn() + 1
  133.   set aclickedphotonum to getnumprevphoto() + aclickedthumbnailnum
  134.   setcurphotonum(aclickedphotonum)
  135.   updatephotothumbnailmarker()
  136. end
  137.  
  138. on getphotothumbnailsprbgn
  139.   set anumphoto to getnumphotoincategory(gcurcategorynum)
  140.   set anumthumbnailline to anumphoto / kphotothumbnailhoriznum
  141.   if (anumphoto mod kphotothumbnailhoriznum) <> 0 then
  142.     set anumthumbnailline to anumthumbnailline + 1
  143.   end if
  144.   set amaxthumbnailline to kmaxphotothumbnailnum / kphotothumbnailhoriznum
  145.   set aemptythumbnailline to amaxthumbnailline - anumthumbnailline
  146.   set athumbnailsprbgn to kphotothumbnailsprnumbgn + (aemptythumbnailline * kphotothumbnailhoriznum)
  147.   return athumbnailsprbgn
  148. end
  149.  
  150. on getnumprevphoto
  151.   set anumprevphoto to 0
  152.   if gcurcategorynum > 1 then
  153.     repeat with acategorycount = 1 to gcurcategorynum - 1
  154.       set anumprevphoto to anumprevphoto + count(getAt(kcategoryphotonums, acategorycount))
  155.     end repeat
  156.   end if
  157.   return anumprevphoto
  158. end
  159.  
  160. on prevphotoclickreaction
  161.   playclicksnd()
  162.   decphotonum()
  163.   updatethumbnailandmarker()
  164. end
  165.  
  166. on nextphotoclickreaction
  167.   playclicksnd()
  168.   incphotonum()
  169.   updatethumbnailandmarker()
  170. end
  171.  
  172. on updatethumbnailandmarker
  173.   set aphotocategorynum to getphotocategorynum(getAt(gcurphotoorder, gcurphotonum))
  174.   if gcurcategorynum <> aphotocategorynum then
  175.     set gcurcategorynum to aphotocategorynum
  176.     if gphotothumbnailonstage then
  177.       showphotothumbnail()
  178.     else
  179.       if gcategorythumbnailonstage then
  180.         showcategorythumbnail()
  181.       end if
  182.     end if
  183.   else
  184.     if gphotothumbnailonstage then
  185.       updatephotothumbnailmarker()
  186.     else
  187.       if gcategorythumbnailonstage then
  188.         updatecategorythumbnailmarker()
  189.       end if
  190.     end if
  191.   end if
  192. end
  193.  
  194. on albummodeclickreaction
  195.   playclicksnd()
  196.   if isemptyalbum() then
  197.     exit
  198.   end if
  199.   donephotomode()
  200.   setautoslidestate(0)
  201.   set galbummode to 1
  202.   set gcurphotoorder to galbumphotoorder
  203.   set gcurphotonum to gsavedalbummodephotonum
  204.   go("album")
  205.   updatephotoview()
  206. end
  207.  
  208. on cameraclickreaction
  209.   if count(galbumphotoorder) < knummaxalbumphotos then
  210.     playsnd(#se, "shutter")
  211.     repeat while sndbusy(#se)
  212.     end repeat
  213.     add(galbumphotoorder, getAt(kdefaultphotoorder, gcurphotonum))
  214.   else
  215.     alert(kalbumfullerrstr)
  216.   end if
  217. end
  218.  
  219. on donephotomode
  220.   set gsavedphotomodephotonum to gcurphotonum
  221.   set gcategorythumbnailonstage to 0
  222.   set gphotothumbnailonstage to 0
  223. end
  224.  
  225. on movielinkfromphotoclicked
  226.   set amovielinknum to getmovielinknum(getAt(gcurphotoorder, gcurphotonum))
  227.   if amovielinknum > 0 then
  228.     playclicksnd()
  229.     donephotomode()
  230.     stopsnd(#bgm)
  231.     go("movie")
  232.     set gcurmovienum to amovielinknum
  233.     updatemovieview()
  234.   end if
  235. end
  236.  
  237. on gomenufromphoto
  238.   donephotomode()
  239.   setautoslidestate(0)
  240.   go("mainmenu")
  241.   unLoad()
  242. end
  243.